unit uDM;
                   
interface             

uses              
  Classes, ADODB, cxEdit, cxStyles, 
  RM_GridReport, RM_e_htm, RM_e_Xls, 
  RM_e_Jpeg, RM_Dataset, RM_e_main, RM_Common, RM_Class, RM_e_Graphic, DB,
  cxContainer;
                              
type
  TDM = class(TDataModule)
    conApp: TADOConnection;
    cxscReadOnly: TcxEditStyleController;
    cxscAddOnlyBrow: TcxEditStyleController;
    cxscAddOnlyEdit: TcxEditStyleController;
    cxscWritableBrow: TcxEditStyleController;
    cxscWritableEdit: TcxEditStyleController;
    cxStyleRepository1: TcxStyleRepository;
    cxStyleHightLine: TcxStyle;
    cxStyleReadOnly: TcxStyle;
    cxStyleWritableBrow: TcxStyle;
    cxStyleWritableEdit: TcxStyle;
    cxStyleAddOnlyBrow: TcxStyle;
    cxStyleAddOnlyEdit: TcxStyle;
    rmgrdrptReport: TRMGridReport;
    rmdsHeader: TRMDBDataSet;
    rmdsDetail: TRMDBDataSet;
    adsReportHeader: TADODataSet;
    adsReportDetail: TADODataSet;
    rmjpgxprt1: TRMJPEGExport;
    rmhtmxprt1: TRMHTMExport;
    rmxlsxprt1: TRMXLSExport;
    adsReportFolder: TADODataSet;
    adsReportItems: TADODataSet;
    adsReportBlod: TADODataSet;
    rmrprtReport: TRMReport;
    procedure adsReportFolderAfterInsert(DataSet: TDataSet);
    procedure adsReportItemsAfterInsert(DataSet: TDataSet);
    procedure adsReportBlodAfterInsert(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DM: TDM;

implementation

uses uPubFuncs;

{$R *.dfm}

procedure TDM.adsReportFolderAfterInsert(DataSet: TDataSet);
begin
  adsReportFolder.FieldByName('FOLDERID').AsInteger := GetNextID('GEN_SYS_RM_FOLDER');
end;

procedure TDM.adsReportItemsAfterInsert(DataSet: TDataSet);
begin
  adsReportItems.FieldByName('ITEM_ID').AsInteger := GetNextID('GEN_SYS_RM_ITEMDATA');
end;

procedure TDM.adsReportBlodAfterInsert(DataSet: TDataSet);
begin
  adsReportBlod.FieldByName('ITEM_ID').AsInteger := GetNextID('GEN_SYS_RM_ITEMDATA');
end;

end.

